<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/layout/common.xhtml">
	<ui:define name="body">
		<h:form id="form" acceptcharset="ISO-8859-1">
			<f:metadata>
				<f:viewParam name="param" value="#{usuarioBean.param}"/>
			</f:metadata>

			<p:panel header="#{msg['massai.usuario.header']}">
				<h:panelGrid cellspacing="3" cellpadding="0">
					<h:panelGrid rendered="#{usuarioBean.usuario.id ne null}">
						<h:outputLabel value="#{msg['massai.usuario.status']}" for="status" />
						<p:selectOneMenu tabindex="1" value="#{usuarioBean.usuario.ativo}" id="status"
							style="width: 100px;" label="#{msg['massai.usuario.status']}">
							<f:selectItems value="#{usuarioBean.statusUsuario()}" />
						</p:selectOneMenu>
					</h:panelGrid>
					
					<h:panelGrid>
						<p:outputLabel value="#{msg['massai.usuario.login']}" for="login" />
						<p:inputText tabindex="2" id="login" value="#{usuarioBean.usuario.login}" required="true" disabled="#{usuarioBean.usuario.id ne null}"
							requiredMessage="#{msg['massai.usuario.login']} é obrigatório(a)." style="width: 150px;" maxlength="20" />
					</h:panelGrid>

					<h:panelGrid>
						<p:outputLabel value="#{msg['massai.usuario.nome']}" for="nome" />
						<p:inputText id="nome" style="width: 350px;" tabindex="3" required="true" 
							requiredMessage="#{msg['massai.usuario.nome']} é obrigatório(a)." value="#{usuarioBean.usuario.nome}" maxlength="100" />
					</h:panelGrid>

					<h:panelGrid>
						<h:outputLabel value="#{msg['massai.usuario.email']}" for="email" />
						<p:inputText id="email" style="width: 350px;" tabindex="4" value="#{usuarioBean.usuario.email}" maxlength="50" />
					</h:panelGrid>
				</h:panelGrid>

				<h:panelGrid style="margin-top: 10px;">
					<h:panelGroup>
						<p:commandButton tabindex="5" value="#{msg['massai.comum.pesquisar']}" ajax="false" 
							immediate="true" action="usuarioPesquisa" 
							style="margin-right: 5px;" />
							
						<p:commandButton tabindex="6" value="#{msg['massai.comum.salvar']}"
							actionListener="#{usuarioBean.salvar()}" ajax="false" 
							style="margin-right: 5px;" />
							
						<p:commandButton tabindex="7" value="#{msg['massai.comum.novo']}" 
							action="usuarioCadastro" ajax="false" immediate="true" 
							style="margin-right: 5px;" />
					</h:panelGroup>
				</h:panelGrid>
			</p:panel>
		</h:form>
	</ui:define>
</ui:composition>
</html>